package cn.bjxy.shishaolong.talk_room.server.entity;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 封装消息的实体类
 * @author long
 *
 */
public class Message {

	//发消息的用户
	private User user;
	//消息内容
	private String content;
	//发送消息的日期时间
	private Date date;
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String text) {
		this.content = text;
	}
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}

	@Override
	public String toString() {
		return user + "  " + new SimpleDateFormat("yyyy年MM月dd日 HH时mm分ss秒").format(date) + "说：\n" + content;
	}
}
